package cn.iune.web.security.shiro;

import java.util.LinkedHashMap;
import java.util.Map;


public class FilterChainDefinitionMap {
	
//	private final Logger log = LoggerFactory.getLogger(FilterChainDefinitionMap.class);
	
	/**
	 * 默认premission字符串
	 */
	public static final String ROLE_STRING = "roles[\"{0}\"]";
	public static final String PREMISSION_STRING = "perms[\"{0}\"]";

	
	public FilterChainDefinitionMap(){
		
	}
	
	public Map<String, String> loadStandardPermissions(){
		
        Map<String, String> map = new LinkedHashMap<String, String>();
        
        //静态资源
        map.put("/static/**", "anon");
        
        //登入登出
        map.put("/logout", "anon");
        map.put("/login", "anon");
        
        //应用中心
        map.put("/appcenter/**", "authc");
        map.put("/usercenter/fastdfsFiles/list", "roles[userAdmin]");
        map.put("/usercenter/org/treeList", "roles[userAdmin]");
        map.put("/usercenter/person/list", "roles[userAdmin]");
        map.put("/usercenter/sysInfoOrg/list", "roles[userAdmin]");
        map.put("/usercenter/role/list", "roles[userAdmin]");
        map.put("/usercenter/orgauth/treeList", "roles[userAdmin]");
       
        //后台管理
        map.put("/backstage/**", "roles[backAdmin]");


//        map.put("/**", "authc");
		
//		Ini.Section section = null;
		System.out.println("开始读取shiro的动态权限配置清单......");
		
		
		return map;
		
	}

}
